//
//  RCCellBottomView.swift
//  RC-微博0305
//
//  Created by 任淳 on 16/3/12.
//  Copyright © 2016年 ReverChun. All rights reserved.
//

import UIKit

class RCCellBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = UIColor(white: 0.92, alpha: 1)
        
        addSubview(btn1)
        addSubview(btn2)
        addSubview(btn3)
        addSubview(line1)
        addSubview(line2)
        
        line1.backgroundColor = UIColor.grayColor()
        line2.backgroundColor = UIColor.grayColor()
        
        setContraints()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setContraints() {
    
        btn1.snp_makeConstraints { (make) -> Void in
            make.top.left.bottom.equalTo(self)
            
        }
        
        btn2.snp_makeConstraints { (make) -> Void in
            make.top.bottom.equalTo(self)
            make.left.equalTo(btn1.snp_right)
            make.right.equalTo(btn3.snp_left)
            //设置btn1 btn2 btn3 的宽度相同 就会三等分
            make.width.equalTo(btn1)
        }
        
        btn3.snp_makeConstraints { (make) -> Void in
            make.top.right.bottom.equalTo(self)
            make.width.equalTo(btn1)
        }
        
        line1.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(btn1.snp_right)
            make.centerY.equalTo(self)
            make.width.equalTo(0.5)
            make.height.equalTo(self).multipliedBy(0.6)
        }
        
        line2.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(btn2.snp_right)
            make.centerY.equalTo(self)
            make.width.equalTo(0.5)
            make.height.equalTo(self).multipliedBy(0.6)
        }
    }
    
    
    lazy var line1 = UIView()
    
    lazy var line2 = UIView()
    
    lazy var btn1 = UIFactory.buttonWithTitle(nil, title: "转发", textColor: UIColor.darkGrayColor(), fontSize: 12 ,imageName: "timeline_icon_retweet")
    
    lazy var btn2 = UIFactory.buttonWithTitle(nil , title: "评论", textColor: UIColor.darkGrayColor(), fontSize: 12, imageName: "timeline_icon_comment")
    
    lazy var btn3 = UIFactory.buttonWithTitle(nil , title: "点赞", textColor: UIColor.darkGrayColor(), fontSize: 12, imageName: "timeline_icon_unlike")
    
}
